#1.先安装PyMySQL 0.10.1，它与Python3.4是兼容的。
import pymysql
#2.创建一个数据库连接
connection = pymysql.connect(host="localhost",user="root",password="root",database="dbshop",charset="utf8")
#3.创建一个游标用于执行SQL语句
cursor=connection.cursor()
#4.执行SQL语句
cursor.execute("DELETE FROM dbshop.dbshop_goods_ask;")
cursor.execute("commit;")
#5.断开数据库连接
connection.close()
